<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        /* 先重置一下html，消除HTML标签默认的内外边距 */
        .wrap {
            width: 800px;
            margin: 0 auto;
        }

        /* 对导航的内容设置一个主体为800px的宽并使其居中 */
        .clear {
            clear: both;
        }

        /* 清除浮动 */
        a {
            text-decoration-line: none;
        }

        /* 去掉默认a标签的下划线 */
        ul,
        li {
            list-style: none;
        }

        nav .level>li {
            float: left;
            width: 16.66%;
            text-align: center;
            background: bisque;
            padding: 10px 0;
            font-size: 16px;
            transition: .4s;
        }

        nav .level>li a {
            color: black;
        }

        nav .level>li:hover {
            background: red;
        }

        /* 设置鼠标滑过后的样式 */

        nav .two {
            display: none;
            margin-top: 10px;
        }

        /* 先使二级菜单的内容隐藏 */
        nav .level>li:hover .two {
            display: block;
        }

        /* 鼠标滑过一级菜单后的显示二级菜单 */
        nav .two li {
            padding: 5px 0;
            transition: .4s;
            cursor: pointer;
        }

        nav .two li:hover {
            background: pink;
        }

        button {
            height: 60px;
            width: 80px;
        }

        #yinyang {
            width: 96px;
            height: 48px;
            background: #eee;
            border-color: red;
            border-style: solid;
            border-width: 2px 2px 50px 2px;
            border-radius: 100%;
            position: relative;
        }

        #yinyang:before {
            content: "";
            position: absolute;
            top: 50%;
            left: 0;
            background: #eee;
            border: 18px solid red;
            border-radius: 100%;
            width: 12px;
            height: 12px;
        }

        #yinyang:after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            background: red;
            border: 18px solid #eee;
            border-radius: 100%;
            width: 12px;
            height: 12px;
        }

        #heart {
            position: relative;
            width: 100px;
            height: 90px;
        }

        #heart:before,
        #heart:after {
            position: absolute;
            content: "";
            left: 50px;
            top: 0;
            width: 50px;
            height: 80px;
            background: red;
            -moz-border-radius: 50px 50px 0 0;
            border-radius: 50px 50px 0 0;
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
            transform: rotate(-45deg);
            -webkit-transform-origin: 0 100%;
            -moz-transform-origin: 0 100%;
            -ms-transform-origin: 0 100%;
            -o-transform-origin: 0 100%;
            transform-origin: 0 100%;
        }

        #heart:after {
            left: 0;
            -webkit-transform: rotate(45deg);
            -moz-transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            -o-transform: rotate(45deg);
            transform: rotate(45deg);
            -webkit-transform-origin: 100% 100%;
            -moz-transform-origin: 100% 100%;
            -ms-transform-origin: 100% 100%;
            -o-transform-origin: 100% 100%;
            transform-origin: 100% 100%;
        }
    </style>
</head>

<body>
    <input type="text" list="input_list" />
    <datalist id="input_list">
        <option value="张三"></option>
        <option value="李四"></option>
    </datalist>
    <progress value="20" max="100"></progress>



    <ul id="list"></ul>
    <div id="info"></div>

    <nav>
        <div class="wrap">
            <ul class="level">
                <li><a href="">首页</a></li>
                <li>
                    <a href="">栏目1</a>
                    <ul class="two">
                        <li>二级菜单1</li>
                        <li>二级菜单2</li>
                        <li>二级菜单3</li>
                    </ul>
                </li>
                <li>
                    <a href="">栏目2</a>
                    <ul class="two">
                        <li>二级菜单4</li>
                        <li>二级菜单5</li>
                        <li>二级菜单6</li>
                    </ul>
                </li>
                <li>
                    <a href="">栏目3</a>
                    <ul class="two">
                        <li>二级菜单7</li>
                        <li>二级菜单8</li>
                        <li>二级菜单9</li>
                    </ul>
                </li>
                <li>
                    <a href="">栏目4</a>
                    <ul class="two">
                        <li>二级菜单10</li>
                        <li>二级菜单11</li>
                        <li>二级菜单12</li>
                    </ul>
                </li>
                <li>
                    <a href="">栏目5</a>
                    <ul class="two">
                        <li>二级菜单13</li>
                        <li>二级菜单14</li>
                        <li>二级菜单15</li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>



    <div id="yinyang"></div>
    <div id="heart"></div>
</body>
<script>
    // 键是ID 值是信息
    var data = {
        01: {
            name: "张三1",
            age: 18
        },
        02: {
            name: "张三2",
            age: 19
        },
        03: {
            name: "张三3",
            age: 20
        }
    };
    var list = document.getElementById('list');
    for (var id in data) {
        var item = data[id];
        var liElement = document.createElement('li');
        liElement.appendChild(document.createTextNode(item.name));
        liElement.setAttribute('data-age', item.age);
        liElement.setAttribute('data-id', item.id);
        list.appendChild(liElement);
        liElement.addEventListener('click', function () {
            alert(this.dataset['age']);
        });
    }
</script>

</html>